package dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import dao.DeptDao;
import entity.Dept;

public class DeptDaoImpl extends HibernateDaoSupport implements DeptDao {

	public void addDept(Dept dept) {
			getHibernateTemplate().save(dept);
	}

	public void updateDept(Dept dept) {
			getHibernateTemplate().update(dept);
	}

	public void deleteDept(Long id) {
			Dept dept=getHibernateTemplate().get(Dept.class, id);
			getHibernateTemplate().delete(dept);
			
	}

	public Dept findOneDeptById(Long id) {
		
		return getHibernateTemplate().get(Dept.class, id);
	}

	public List<Dept> findAllDept() {
		
		return getHibernateTemplate().find("from Dept");
	}

	public List<Dept> findDeptsByCondition(Map map) {
		
		return null;
	}

}
